package com.ycsty.democlient.controller;

import com.ycsty.service.HelloService;
import com.ycsty.service.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ClientController {

    /**
     * 注意这里的导包
     * import org.apache.dubbo.config.annotation.Reference;
     */

    @Reference
    HelloService helloService;

    @Reference
    UserService userService;

    @GetMapping("/hello")
    public String sayHello() {
        return helloService.sayHello("ycsty");
    }

    @GetMapping("/haha")
    public String sayHaha() {
        return helloService.sayHaha("ycsty");
    }

    @GetMapping("/length")
    public String length() {
        return userService.getNameLength("ycsty");
    }

}
